package com.cnunicom.common.utils;

/**
 * @Author: dingziyuan
 * @Date: 2020/2/5/005 8:52
 * @Description: *
 */
public class StringUtil {
    public static String bytesToHexStr(byte[] bytes) {
        StringBuilder sb = new StringBuilder();
        for (byte aByte : bytes) {
            String hexStr = Integer.toHexString(aByte & 0xff);
            if (hexStr.length() < 2) {
                sb.append(0);
            }
            sb.append(hexStr);
        }
        return sb.toString();
    }

}
